package com.example.sportplay.controller;

import com.alibaba.fastjson.JSON;
import com.example.sportplay.bean.MainMenu;
import com.example.sportplay.bean.QueryInfo;
import com.example.sportplay.bean.User;
import com.example.sportplay.dao.MenuDao;
import com.example.sportplay.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.List;

//@Repository
//public class UserController {
//    @Autowired
//    private UserDao userDao;
//    MenuDao menuDao;
//    @CrossOrigin
//    @RequestMapping("/allUser")
//    public String getUserList(QueryInfo queryInfo){
////        System.out.println(queryInfo);
////        int numbers = userDao.getUserCounts("%"+queryInfo.getQuery()+"%");// 获取数据总数
////        int pageStart = (queryInfo.getPageNum()-1)*queryInfo.getPageSize();
////        List<User> users = userDao.getAllUser("%"+queryInfo.getQuery()+"%",pageStart,queryInfo.getPageSize());
////        HashMap<String, Object> res = new HashMap<>();
////        int numbers=5;
////        res.put("numbers",numbers);
////       // res.put("data",users);
////        System.out.println("总条数："+numbers);
////        String users_json = JSON.toJSONString(res);
////        return users_json;
////
////
////
////
////        HashMap<String, Object> data = new HashMap<>();
////        List<MainMenu> mainMenus = menuDao.getMainMenus();
////        data.put("data",mainMenus);
////        data.put("status",200);
////        String s = JSON.toJSONString(data);
//////        Str.]ing data_json = JSON.toJSONString(data);
////        System.out.println("成功访问2");
////        return s;
//    }
//
//
//}
